#include"ThreadPool.hpp"
#include"Task.hpp"
#include"LockGuard.hpp"

int main()
{
  ThreadPool<Task>* threads = new ThreadPool<Task>();
  threads->init();
  threads->Start();
  while(true)
  {
    int x = 0,y = 0;
    char op;

    {
      LockGuard Lock(&mutex);
      cout << "please input x : ";
      cin >> x; 

      cout << "please input y : ";
      cin >> y;

      cout << "please input op(+-*/%) : ";
      cin >> op;
    }
    Task task(x,y,op);
    threads->push(task);
    sleep(1);
  }
  return 0;
}
